const express   = require('express');
const Favorite  = require('../controllers/favorite');
const router    = express.Router();

/**
 * @desc    查询当前用户已购书籍
 * @method  {*请求方法} POST
 */
router.post('/add', function (req, res, next) {
    Favorite.add(req, res, next);
})

/**
 * @desc    查询当前用户已购书籍
 * @method  {*请求方法} GET
 */
router.get('/', function (req, res, next) {
    Favorite.findByUserId(req, res, next);
})

module.exports = router;
